﻿<!--#include file="const.inc"-->
<%
'====================================================================
' 感谢使用晴天3G智能建站系统..
' 作者:梁永强.QQ:766750857
' 官方网址:wap.qt3g.com
' 声明:软件版权归作者所有,没有经过作者本人同意不得非法破解和传播本程序
'====================================================================
%>


<%
dim rs,sql,i,Page,count,PageCount,kw
dim RndTXT
	const PageSize=10	'每页10

    	kw = qingtian.RepSQL(trim(Request("kw")))
    	Page = Request("page")      '当前页数
    	If Page = "" Then Page = 1
   	If Not IsNumeric(Page) Then Page = 1
    	Page = CLng(Page)
    	If Page < 1 Then Page = 1
         phonename=qingtian.phonename(midqd,1)
	randomize
	RndTXT=int((99999999)*rnd+1)
Set Rs = Server.CreateObject("Adodb.Recordset")
select case v
case "0"
we0="<br/>"
book1="<input name=""PostField1"" value=""""  size='15' emptyok=""true"" /><br/>我要搜<anchor>软件<go href=""search.asp?sid="&sidd&""" method=""post""><postfield name=""kw"" value=""$(PostField1)"" /></go></anchor><br/>"
book="跳到第<input name='Page' format='*N' size='2' maxlength='5'/><a href='search.asp?kw="&server.URLEncode(kw)&"&amp;page=$(Page:n)&amp;sid="&sidd&"'>页</a><br/>"
%>
<card title="软件搜索"><p align="<%=qingtian.px%>">
<%
case "1"
zi="<span style=""color:#FF5500"">"
zi0="</span>"
we="<div class=""footer"">"
sou="<div class=""block4"">"
dao="<div class=""navi"">"
we0="</div>"
book1="<form action=""search.asp?sid="&sidd&""" method=""post""><input name='kw' emptyok=""true"" size='15' maxlength='128'/><br/><input type=""submit"" value=""我要搜软件"" /></form><br/>"
book="<form action=""search.asp?kw="&server.URLEncode(kw)&"&amp;sid="&sidd&""" method=""post"">跳到第<input name='Page' format='*N' size='2' maxlength='5'/><input type=""submit"" value=""页"" /></form><br/>"
%>
<title>软件搜索</title>
</head>
<body>
<!--#include virtual="/css.inc"-->
<%

End Select

%>
	
<%=qingtian.qingsav("5")%>
<%=we%>搜索.<a href="newli.asp?act=1&amp;sid=<%=sidd%>">最新</a>.<a href="downli.asp?act=1&amp;sid=<%=sidd%>">最热</a>.<a href="tuijianli.asp?act=1&amp;sid=<%=sidd%>">推荐</a><%=we0%>
<%=book1%>
<%


	if kw<>"" then

	


      	Sql = "select a.id,a.name,a.namet,a.downCount FROM qingtian_fileli a,qingtian_phoneurl b WHERE (b.bid="&phonename&" or b.bid=0) and a.id=b.aid and (a.name  like '%"&kw&"%' or a.namet  like '%"&kw&"%' or b.fileext  like '%"&kw&"%' or a.content  like '%"&kw&"%') "
      	rs.open sql,conn,1,3
	if not (rs.bof and rs.eof)  then
			Rs.PageSize = PageSize


			IF Not IsEmpty(Page) Then
				IF Not IsNumeric(Page) Then '判断Page是否为数字
					Page=1
				Else
					Page=Cint(Page) '转换成短整形Integer
				End IF
				IF Page > Rs.PageCount  Then
					Rs.AbsolutePage = Rs.PageCount '设置当前显示页等于最后一页
				ElseIF Page <= 0 Then
					Rs.AbsolutePage = 1 '设置当前页等于第一页
				Else
					Rs.AbsolutePage = Page '如果大于零,显示当前页等于接收的页数
				End IF
			Else
				Rs.AbsolutePage = 1
			End IF
				Page = Rs.AbsolutePage

			%>
			<%=we%>共找到相关软件<%=rs.RecordCount%>条<%=we0%>
			<%
		For i=1 to Rs.PageSize
			If Rs.Eof Then
				exit For
			End If
if qingtian.bbs=true and Request.QueryString("act")=1 then
rs.delete()
Response.Write("删除成功<br/>")
else
			%><%
dat=(page-1)*PageSize+i
dat1=dat mod 2
if dat1=0 then
%>
<%=we%><%=zi%><%=dat%>.<a href="fileve.asp?id=<%=rs("id")%>&amp;sid=<%=sidd%>&amp;backurl=index.asp"><%=qingtian.utf8(rs("namet"))%>|<%=qingtian.utf8(rs("name"))%></a>(<%=rs("downCount")%>)<%=we0%>
<%
else
%>
<%=sou%><%=zi%><%=dat%>.<a href="fileve.asp?id=<%=rs("id")%>&amp;sid=<%=sidd%>&amp;backurl=index.asp"><%=qingtian.utf8(rs("namet"))%>|<%=qingtian.utf8(rs("name"))%></a>(<%=rs("downCount")%>)<%=we0%>
<%
End If
End If
		Rs.MoveNext
		Next

    		'分页
                if rs.PageCount>1 then
                    Response.Write dao
                end if
    		If Page < rs.PageCount Then
    		    Response.Write("<a href='search.asp?kw="&server.URLEncode(kw)&"&amp;page=" & Page + 1 & "&amp;sid="&sidd&"'>下一页</a>")
    		End If
       
    		If Page > 1 And Page < rs.PageCount Then
    		    Response.Write("|")
    		End If
        
    		If Page > 1 Then
    		    Response.Write("<a href='search.asp?kw="&server.URLEncode(kw)&"&amp;page=" & Page - 1 & "&amp;sid="&sidd&"'>上一页</a>"&we0&"")
    		Elseif rs.PageCount >1 then
    		    Response.Write(""&we0&"")
    		End If
            if qingtian.bbs=true then Response.Write(""&sou&"<a href='search.asp?act=1&amp;kw="&server.URLEncode(kw)&"&amp;page=" & Page& "&amp;sid="&sidd&"'>删除当前页文件</a>"&we0&"")
    		If rs.PageCount > 2 Then
    		   %>
		<%=book%>
		<%
    		Response.Write("" & we & "(第" & Page & "/总" & rs.PageCount & "页/共" & rs.RecordCount & "条)" & we0 & "")
    		End If
                                                                
		else

			%>
			<%=we%>没有找到相关软件。<%=we0%>
		<%end if
		Rs.close
		set rs=nothing

		else
			%><%=we%>搜索内容不能为空。<%=we0%><%
		end if
%><%=qingtian.qingsav("6")%>

<%
end Function
%>
